#include"SmartPoint.hpp"

void test1()
{
  Mango::auto_ptr<int> ap(new int(10));
  Mango::auto_ptr<int> app(ap);
  *app = 20;
  cout << *app << endl;
}

void test2()
{
  using namespace Mango;
  Mango::shared_ptr<int> sp1(new int(10));
  shared_ptr<int> sp2(sp1);
  cout << *sp1 << " " << *sp2 <<  endl;
  *sp2 = 20; 
  cout << *sp1 << " " << *sp2 <<  endl;
  cout << sp1.use_count() << endl;

  shared_ptr<int> sp3(new int(3));
  sp1 = sp3;
  cout << sp2.use_count() << endl;
  cout << sp3.use_count() << endl;
  
  cout << *sp1 << " " << *sp2 <<  " " << *sp3 << endl;
}
int main()
{
  test2();
  return 0;
}
